//
//  WeiboBaseViewController.swift
//  微博
//
//  Created by LH on 2017/5/23.
//  Copyright © 2017年 LH. All rights reserved.
//

import UIKit
class WeiboBaseViewController: UIViewController {
    //自定义导航
    lazy var navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: UIScreen.cz_screenWidth(), height: 64))
    lazy var navItem = UINavigationItem()
    override func viewDidLoad() {
        super.viewDidLoad()
        
        setupUI()
        
    }
    
    override var title: String?{
        didSet{
            navItem.title = title
        }
    }
    
    
}
// MARK: - 设置界面   option+command +/
extension WeiboBaseViewController{
    func setupUI() {
        view.backgroundColor = UIColor.cz_random()
        view.addSubview(navigationBar)
        navigationBar.items=[navItem]
        //设置navbar的渲染颜色
        navigationBar.barTintColor = UIColor.red
        //设置NavBar的字体颜色
        navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.darkGray]
        
    }
}

